-
-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new Channel API for experimental plugins feature #5141
Conversation
411ee63
to
786782d
Compare
786782d
to
59f13d2
Compare
docs/chatterino.d.ts
Outdated
class Channel implements IWeakResource { | ||
is_valid(): boolean; | ||
get_name(): string; | ||
get_type(): ChannelType; | ||
get_display_name(): string; | ||
is_twitch_channel(): boolean; | ||
|
||
static by_name(name: string, platform: Platform): null | Channel; | ||
static by_twitch_id(id: string): null | Channel; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there send_message
and add_system_message
missing, because send_msg
and system_msg
were removed a few lines below this class definition and in the plugin-meta.lua
there are those functions defined as member of Channel
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are missing, thank you for reminding me of that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just add the missing documentation to class Channel
…erino2 into feature/lua-channel-api
…re/lua-channel-api
I saw this PR just now and noticed two things:
|
@4rneee Could you create an issue to track that? Super helpful feedback |
Example usage:
When Chatterino deletes the Channel, all lua ChannelRefs to it expire and using them will produce an error. It is possible to check for this before using those functions with
Channel:is_valid()
. I expect that other weak objects will have identical methods, I created IWeakResource interface class which defines this method.Breaking
This PR removes
c2.system_msg
andc2.send_msg
.